import com.kehongborui.spring.entity.ComplexObject;
import com.kehongborui.spring.entity.User;
import com.kehongborui.spring.service.LoginService;
import org.apache.commons.dbcp.BasicDataSource;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Date;

/**
 * @author zhang peng yang ming
 * @CopyRight (C) http://www.csdn.com
 * @brief
 * @email 122162005@qq.com
 * @date 2018-07-30
 */
public class StaticFactoryMethodDemoTest {
    @Test
    public void testStaticFactoryMethod() {
        // 实例化容器
        ApplicationContext context = new ClassPathXmlApplicationContext("appContext.xml");
        System.out.println("\n\n\n\n\n\n\n\n\n");
        LoginService loginService = context.getBean("loginService", LoginService.class);
        User user = loginService.login("admin", "1234");

        System.out.println(user);
    }
}
